Arexx (4/45)

From:Ash Wyllie
Date:11 Aug 2001 at 16:29:40
Subject:Re: Back to my "ITERATE" problem

Gently extracted from the mind of Andrew Bruno;

>Hi,

>I have now got back into the swing of things and am playing with this
>"terminate the loop" thing.

>This is the example program:

>/* */

>ECHO 'Starting the program.'

>test.1 = "ANDREW"
>test.2 = "BARNEY"
>test.3 = "CHARLIE"
>test.4 = "DANNIEL"
>test.5 = "EDWARD"
>test.6 = "FREDERICK"

>name = "EDWARD"

>DO i = 1 to 6
> IF name = test.i THEN
> DO
> ECHO 'Found'
> ITERATE i
> END
> ECHO i
>END

>ECHO 'Exiting program'

>The ITERATE i line is added later but this is what I get with the line in:

>Starting the program.
>1
>2
>3
>4
>Found
>6
>Exiting program

>Without:

>Starting the program.
>1
>2
>3
>4
>Found
>5
>6
>Exiting program

>So I guess the ITERATE command is not doing what I want.

>I guess the best way to do it is instead of the ITERATE i line, I should put
>in i=6 and it will then stop altogether - right?

>I am posting this as obvious as the answer is, to maybe help others who
>are/were as confused as I was when I asked the question.

>:)

I assume that you wish to know which i gives (test.i = name). If that is true
replace ITERATEe with LEAVE.

-ash
for assistance dial MYCROFTXXX

ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/